package com.social.service.houseKeeperMy.impl;

import com.social.entity.HouseKeeper;
import com.social.entity.HouseKeeperMy;
import com.social.mapper.HouseKeeperMapper;
import com.social.mapper.HouseKeeperMyMapper;
import com.social.service.houseKeeperMy.HouseKeeperMyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * Created by Administrator on 2017/8/16.
 */
@Service(value = "houseKeeperMyService")
public class HouseKeeperMyServiceImpl implements HouseKeeperMyService {

    @Autowired
    private HouseKeeperMyMapper houseKeeperMyMapper;//这里会报错，但是并不会影响

    @Override
    public int addHouseKeeper(HouseKeeperMy houseKeeper) {

        return houseKeeperMyMapper.insert(houseKeeper);
    }

    @Override
    public List<HouseKeeperMy> getHouseKeeperMyList(Map<String,Object> params) {
        return houseKeeperMyMapper.getHouseKeeperMyList(params);
    }

    @Override
    public HouseKeeperMy selectByPrimaryKey(Map<String,Object> params) {
        return houseKeeperMyMapper.selectByPrimaryKey(params);
    }@Override
    public HouseKeeperMy selectByPrimaryKeyString(String id) {
        return houseKeeperMyMapper.selectByPrimaryKeyString(id);
    }

    @Override
    public int updateByPrimaryKeySelective(HouseKeeperMy record) {
        return houseKeeperMyMapper.updateByPrimaryKeySelective(record);
    }

    @Override
    public int deleteByAdminId(Map<String, Object> params) {
        return houseKeeperMyMapper.deleteByAdminId(params);
    }
//
//    /*
//    * 这个方法中用到了我们开头配置依赖的分页插件pagehelper
//    * 很简单，只需要在service层传入参数，然后将参数传递给一个插件的一个静态方法即可；
//    * pageNum 开始页数
//    * pageSize 每页显示的数据条数
//    * */
//    @Override
//    public PageInfo<User> findAllUser(User user) {
//
//        PageHelper.startPage(1, 10);
//        List<User> userDomains = userMapper.selectAllUser(user);
//        PageInfo result = new PageInfo(userDomains);
//        return result;
//    }
}
